function originFetch(url) {
  return new Promise((resolve, reject) => {
    console.log('fetch', url)
    setTimeout(() => {
      resolve(url)
    }, 1000)
  })
}
// function getFetch() {
//   let p = Promise.resolve(0)
//   return function (url) {
//     p = p.then(() => {
//       return originFetch(url)
//     })
//   }
// }
// const fetchOne = getFetch()
function fetchOne(url) {
  if (!fetchOne.aa) {
    fetchOne.aa = originFetch(url)
  } else {
    fetchOne.aa = fetchOne.aa.then(() => {
      return originFetch(url)
    })
  }
}
fetchOne(1)
fetchOne(2)
fetchOne(3)
fetchOne(4)
